﻿@model FCNS.ERP.Models.ErpOrderPay

@{
    ViewBag.Title = "收支单-编辑";
    Layout ="~/Views/Shared/_Layout.cshtml";
}

<link href="~/Content/Combo/combo.select.css" rel="stylesheet" />
<script src="~/Scripts/Combo/jquery.combo.select.js"></script>

<script type="text/javascript">
    $(document).ready(function () {
        $("#CorSId").comboSelect();
    });
</script>

<h2>@ViewBag.Title</h2>

@using (Html.BeginForm())
{
    @Html.AntiForgeryToken()
    
<div class="form-horizontal">
    <hr />
    @Html.ValidationSummary(true, "", new { @class = "text-danger" })
    @Html.HiddenFor(model => model.Id)
    @Html.HiddenFor(model => model.OrderNO)
    @Html.HiddenFor(model => model.IsIn)

    <div class="form-group">
        @Html.LabelFor(model => model.PayType, htmlAttributes: new { @class = "control-label col-md-2" })
        <div class="col-md-10">
            <select class="form-control" data-val="true" data-val-required="单据类型 字段是必需的。" id="PayType" name="PayType">
                @if (Model.PayType == FCNS.ERP.Models.ErpOrderPay.EnumOrderPayType.其它收入单)
                {
                    <option selected="selected" value="0">其它收入单</option>
                    <option value="1">其它支出单</option>
                }
                else
                {
                    <option value="0">其它收入单</option>
                    <option selected="selected" value="1">其它支出单</option>
                }
            </select>
            @Html.ValidationMessageFor(model => model.PayType, "", new { @class = "text-danger" })
        </div>
    </div>
    <div class="form-group">
        @Html.LabelFor(model => model.BankId, htmlAttributes: new { @class = "control-label col-md-2" })
        <div class="col-md-10">
            @Html.DropDownList("BankId", ViewData["Bank"] as SelectList, htmlAttributes: new { @class = "form-control" })
            @Html.ValidationMessageFor(model => model.BankId, "", new { @class = "text-danger" })
        </div>
    </div>
    <div class="form-group">
        @Html.LabelFor(model => model.DateTimeStart, htmlAttributes: new { @class = "control-label col-md-2" })
        <div class="col-md-10">
            @Html.EditorFor(model => model.DateTimeStart, new { htmlAttributes = new { @Value = String.Format("{0:yyyy-MM-dd}", Model.DateTimeStart), @class = "form-control", @type = "date" } })
            @Html.ValidationMessageFor(model => model.DateTimeStart, "", new { @class = "text-danger" })
        </div>
    </div>

    <div class="form-group">
        @Html.LabelFor(model => model.Money, htmlAttributes: new { @class = "control-label col-md-2" })
        <div class="col-md-10">
            @Html.EditorFor(model => model.Money, new { htmlAttributes = new { @class = "form-control" } })
            @Html.ValidationMessageFor(model => model.Money, "", new { @class = "text-danger" })
        </div>
    </div>

    <div class="form-group">
        @Html.LabelFor(model => model.CorSId, htmlAttributes: new { @class = "control-label col-md-2" })
        <div class="col-md-10">
            @Html.DropDownList("CorSId", ViewData["CorS"] as SelectList, htmlAttributes: new { @class = "form-control" })
            @Html.ValidationMessageFor(model => model.CorSId, "", new { @class = "text-danger" })
        </div>
    </div>

    <div class="form-group">
        @Html.LabelFor(model => model.Summary, htmlAttributes: new { @class = "control-label col-md-2" })
        <div class="col-md-10">
            @Html.TextAreaFor(model => model.Summary, new { htmlAttributes = new { @class = "form-control" } })
            @Html.ValidationMessageFor(model => model.Summary, "", new { @class = "text-danger" })
        </div>
    </div>

    <div class="form-group">
        <div class="col-md-offset-2 col-md-10">
            <input type="submit" value="保存" class="btn btn-default" />
        </div>
    </div>
</div>
}

<div>
    <a class="backToListImg" href="/Pay/OrderPay">返回</a>
</div>
